<%@page import="java.util.ArrayList"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!doctype html>
<html lang="en">
  <head>
    
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="网络程序设计(苏航)-期末作业">
    <meta name="author" content="赵云雷">
    <meta name="student number" content="18061119">
    <title>云雷书店</title>


    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css">
    <script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.slim.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/js/bootstrap.bundle.min.js" ></script>


    <style>
      .bd-placeholder-img {
        font-size: 1.125rem;
        text-anchor: middle;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
      }

      @media (min-width: 768px) {
        .bd-placeholder-img-lg {
          font-size: 3.5rem;
        }
      }
    </style>

    
    <!-- Custom styles for this template -->
    <link href="jumbotron.css" rel="stylesheet">
  </head>
  <body>
    <%@ include file="tabBar.jsp"%>
    
    
    <div class="jumbotron">
    <table class="table">
        <thead class="thead-dark">
        <tr>
            <th scope="col">编号</th>
            <th scope="col">名字</th>
            <th scope="col">作者</th>
            <th scope="col">出版社</th>
            <th scope="col">库存</th>
            <th scope="col">单价</th>
            <th scope="col">详情</th>
        </tr>
        </thead>
        <tbody>
            <% ArrayList<ArrayList<String>> bookDetail = (ArrayList)session.getAttribute("bookDetail");%>
            <% if(bookDetail != null)  {%>
            <% for (ArrayList<String> i : bookDetail) {%>
            <tr>
                <td><%=i.get(0)%></td>
                <td><%=i.get(1)%></td>
                <td><%=i.get(4)%></td>
                <td><%=i.get(5)%></td>
                <td><%=i.get(2)%></td>
                <td><%=i.get(3)%></td>
                <td>
                    <form method="post" action="control?page=directory&submit=detail">
                        <input type="hidden" name="bookID" value="<%=i.get(0)%>">
                        <button type="submit" class="btn btn-primary">查看详情</button>
                    </form>
                </td>
            </tr>
            <%}%>
            <%}%>
        </tbody>
    </table>   
    </div>
  </body>
</html>
